﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model;
using DAL;
namespace BLL
{
   public class MaintainBll
    {
       MaintainDal dal = new MaintainDal();
       public Maintain BackMaintain(int id)
       {
           return dal.Back(id);
        }
       public bool AddMaintain(Maintain m)
       {
           return dal.Add(m);
       }

       public List<Maintain> ShowMaintain()
       {
           return dal.Show();
       }
       public bool UpdateMain(Maintain main,int id)
       {
           return dal.Update(main,id);
       }
       public List<Maintain> PaperMaintain(string UserName, int PageIndex, int PageSize, out int PageCount)
       {
           PageCount = dal.Show().Where(t => t.MaintainPeople == UserName).Count();
           return dal.Show().Where(t => t.MaintainPeople == UserName).Skip((PageIndex - 1) * PageSize).Take(PageSize).ToList();
       }
    }
}
